<template>
  <div class="order-container">
    <h1>订单管理</h1>
    
    <el-tabs v-model="activeTab">
      <el-tab-pane label="待处理" name="pending"></el-tab-pane>
      <el-tab-pane label="处理中" name="processing"></el-tab-pane>
      <el-tab-pane label="已完成" name="completed"></el-tab-pane>
      <el-tab-pane label="已取消" name="cancelled"></el-tab-pane>
    </el-tabs>
    
    <el-table :data="orders" style="width: 100%">
      <el-table-column prop="id" label="订单号" width="120"></el-table-column>
      <el-table-column prop="user" label="客户"></el-table-column>
      <el-table-column prop="createTime" label="下单时间" width="180"></el-table-column>
      <el-table-column prop="status" label="状态" width="120"></el-table-column>
      <el-table-column prop="total" label="总金额" width="120"></el-table-column>
      <el-table-column label="操作" width="200">
        <template slot-scope="scope">
          <el-button size="mini" type="primary" @click="viewOrder(scope.row)">查看</el-button>
          <el-button size="mini" type="success" @click="processOrder(scope.row)">处理</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'MerchantOrder',
  data() {
    return {
      activeTab: 'pending',
      orders: []
    }
  },
  created() {
    // Load orders
    console.log('Loading merchant orders')
  },
  methods: {
    viewOrder(order) {
      console.log('View order', order)
    },
    processOrder(order) {
      console.log('Process order', order)
    }
  }
}
</script>

<style scoped>
.order-container {
  padding: 20px;
}
</style> 